<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="keyword" content="">

    <title>项目列表-工程巡查管理</title>

    <!-- Bootstrap core CSS -->
    <link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet">
    <link href="__PUBLIC__/css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="__PUBLIC__/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <link href="__PUBLIC__/assets/jquery-easy-pie-chart/jquery.easy-pie-chart.css" rel="stylesheet" type="text/css" media="screen"/>
    <link rel="stylesheet" href="__PUBLIC__/css/owl.carousel.css" type="text/css" />
    <!-- Custom styles for this template -->
    <link href="__PUBLIC__/css/style.css" rel="stylesheet" />
    <link href="__PUBLIC__/css/style-responsive.css" rel="stylesheet" />
    <!-- new styles-->
      <link href="__PUBLIC__/css/xxxstyle.css" rel="stylesheet" />
    
       <link rel="stylesheet" href="__PUBLIC__/css/jquery.treeview.css" />

      <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
      <script src="__PUBLIC__/js/html5shiv.js"></script>
      <script src="__PUBLIC__/js/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

  <section id="container">
      <!--main content start-->
      <section id="main-content">
          <section class="wrapper">
              <div class="row">
                  <div class="col-xs-12 maxColWid" id="taskdetail">
                     	 <div class="row">
                          <div class="col-xs-12">
                              <section class="panel iframeMinHeight">
                                  <header class="panel-heading"><i class="icon-tag iconRed"></i>{$task.name}
                                     <span class="tools pull-right">
                                     	  <button type="button" class="btn btn-default btn-xs" onclick="javascript:window.history.back();return false;"><i class="icon-reply"></i>返回</button>                                 
                                   </span>
                                  </header>
                                  <div class="panel-body">
                                      <div class="task-table-1 conProj">
                                          <div class="t1-row">
                                              <div class="row1-1 t1-bgA">任务名称</div>
                                              <div class="row4-1">{$task.name}</div>
                                              <div class="row2-1 t1-bgA">任务类型</div>
                                              <div class="row2-2">{$task_status['type'][$task['type']]}</div>
                                          </div>
                                          <div class="t1-row">
                                              <div class="row2-1 t1-bgA">指派给</div>
                                              <div class="row2-2">{$task.assigname}</div>
                                              <div class="row2-1 t1-bgA">任务状态</div>
                                                <?php $time = strtotime($task['t_stop']);
		                                                      		$time1 = time();
		                                                      ?>
		                                       <if condition="$time1 gt $time && $task['status'] neq 4">
		                                       <div class="row2-2"><span style="color:red;">任务已超时</span></div>
		                                       <else/>
                                              <div class="row2-2">{$task_status['status'][$task['status']]}</div>
                                              </if>
                                              <div class="row2-1 t1-bgA">结束日期</div>
                                              <div class="row2-2">{$task.t_stop}</div>
                                          </div>
                                          <div class="t1-row">
                                              <div class="row1-1 t1-bgA">来自</div>
                                              <div class="row4-1">{$task.cfrom}</div> 
                                              <div class="row2-1 t1-bgA">优先级</div>
                                              <div class="row2-2">{$task_status['priority'][$task['priority']]}</div>
                                            <!--   <div class="row1-1 t1-bgA">严重程度</div>
                                              <div class="row2-2">{$task_status['severity'][$task['severity']]}</div> -->
                                          </div>                                                                           
                                      </div>                                 
                                      <div class="task-details">                                        
                                          <div class="collisionReport-table">
                                              <div class="cRtable-row">
                                                  <div class="cRow-9 cRtable-bg">任务内容</div>                                                 
                                              </div>
                                              <div class="cRtable-row">
                                                  <div class="cRow-9 cRowY">{$task.describe|json_decode}</div>                                              
                                              </div>
                                          </div>
                                      </div>
                        <if condition="$task['type'] neq 3">
                               <!-- 未上传附件  任务状态为进行中-->
	                            <if condition="$task['status'] eq 2">          
	                                      <div class="task-details">
	                                          <div class="rowComTitle">执行</div>
	                                          <div class="row mt25">
	                                              <div class="col-xs-2">
	                                                <p class="rowComLabel">备注</p>
	                                              </div>
	                                              <div class="col-xs-10">
	                                                <textarea class="form-control" rows="4" placeholder="请输入内容(50字内)" name="remarks" maxlength="50"></textarea> 
	                                              </div>
	                                          </div>                              
	                                          <div id="TaskUpload" class="TaskUploadBox"></div>
	                                          <div class="cReport-btn">
	                                              <button type="submit" class="btn btn-submit" onclick="findings()">上传成果</button>
	                                          </div>
	                                      </div>
	                            </if>      
                                      <!--上传附件完成 任务状态待审核中-->
								 <if condition="$task['status'] eq 7">
	                                      <!--执行人 看-->
	                                      <div class="task-details">
	                                          <div class="collisionReport-table rowComMargin">
	                                              <div class="cRtable-row">
	                                                  <div class="cRow-9 cRtable-bg">备注</div>                                                 
	                                              </div>
	                                              <div class="cRtable-row">
	                                                  <div class="cRow-9 cRowY">{$remarks.remarks}</div>                                              
	                                              </div>
	                                          </div>
	                                          <div class="row rowComMargin">
	                                              <div class="col-xs-2">
	                                                <p class="rowComLabel">附件</p>
	                                              </div>
	                                              <div class="col-xs-10 rowComA">
	                                              <foreach name="enclosure" item="v" key="k">
	                                                <a href="{:U('Bim/downLink',array('id'=>$v['id'],'name'=>$v['name'],'filename'=>$v['mname']))}">{$v.name}</a>
	                                              </foreach>
	                                              </div>
	                                          </div>
	                                      </div>
	                                      <!--执行人 看-->
								 </if>
										<!-- 驳回 -->
								 <if condition="$task['status'] eq 5">          
	                                      <div class="task-details">
	                                          <div class="rowComTitle">执行</div>
	                                           <div class="collisionReport-table rowComMargin">
	                                              <div class="cRtable-row">
	                                                  <div class="cRow-9 cRtable-bg">驳回意见</div>                                                 
	                                              </div>
	                                              <div class="cRtable-row">
	                                                  <div class="cRow-9 cRowY">{$remarks.remarks}</div>                                              
	                                              </div>
	                                          </div>
	                                          <div class="row mt25">
	                                              <div class="col-xs-2">
	                                                <p class="rowComLabel">备注</p>
	                                              </div>
	                                              <div class="col-xs-10">
	                                                <textarea class="form-control" rows="4" placeholder="请输入内容(50字内)" name="remarks" maxlength="50"></textarea> 
	                                              </div>
	                                          </div>                              
	                                          <div id="TaskUpload" class="TaskUploadBox"></div>
	                                          <div class="row rowComMargin">
	                                              <div class="col-xs-2">
	                                                <p class="rowComLabel">附件</p>
	                                              </div>
	                                              <div class="col-xs-10 rowComA">
	                                              <foreach name="enclosure" item="v" key="k">
	                                                <a href="{:U('Bim/downLink',array('id'=>$v['id'],'name'=>$v['name'],'filename'=>$v['mname']))}">{$v.name}</a>
             	                                    <button style="margin-right:15px;color:red;cursor:pointer" onclick="de({$v.id},'{$v.mname}');">删除</button>
	                                              </foreach>
	                                              </div>
	                                          </div>
	                                          <div class="cReport-btn">
	                                              <button type="submit" class="btn btn-submit" onclick="findings()">重新上交成果</button>
	                                          </div>
	                                      </div>
	                             </if>  
	                             <!--已完成-->
								 <if condition="$task['status'] eq 4">    
								 	 <div class="task-details">
                                          <div class="collisionReport-table rowComMargin">
                                              <div class="cRtable-row">
                                                  <div class="cRow-9 cRtable-bg">成果备注</div>                                                 
                                              </div>
                                              <div class="cRtable-row">
                                                  <div class="cRow-9 cRowY">{$remark.remarks}</div>                                              
                                              </div>
                                          </div>
                                          <div class="row rowComMargin">
                                              <div class="col-xs-2">
                                                <p class="rowComLabel">附件</p>
                                              </div>
                                              <div class="col-xs-10 rowComA">
                                              <foreach name="enclosure" item="v" key="k">
                                                 <a href="{:U('Bim/downLink',array('id'=>$v['id'],'name'=>$v['name'],'filename'=>$v['mname']))}">{$v.name}</a>
                                              </foreach>
                                              </div>
                                          </div>
                                      </div>
                                     <div class="task-details">
                                         <div class="collisionReport-table rowComMargin">
                                             <div class="cRtable-row">
                                                 <div class="cRow-9 cRtable-bg">审核意见</div>                                                 
                                             </div>
                                             <div class="cRtable-row">
                                                 <div class="cRow-9 cRowY">{$remarks.remarks}</div>                                              
                                             </div>
                                         </div>
                                     </div>
                                </if>
                            </if>
                                  </div>
                              </section>
                          </div>
                      </div>
                      
                  </div>
              </div>
          </section>
      </section>
      <!--main content end-->
  </section>

    <!-- js placed at the end of the document so the pages load faster -->
    <script src="__PUBLIC__/js/jquery.js"></script>
    <script src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
    <script src="__PUBLIC__/js/bootstrap.min.js"></script>
    <script src="__PUBLIC__/js/jquery.scrollTo.min.js"></script>
    <script src="__PUBLIC__/js/jquery.nicescroll.js" type="text/javascript"></script>
    <script src="__PUBLIC__/js/jquery.customSelect.min.js" ></script>
<!-- 	<script src="__PUBLIC__/js/common-scripts.js"></script> -->
    <!--common script for all pages-->
  <!--   <script src="__PUBLIC__/js/common-scripts.js"></script> -->

    <!--new script for this page only-->
    <script type="text/javascript" src="__PUBLIC__/js/jquery.Huploadifyy.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/layer/layer.js"></script>
    <script type="text/javascript">
        $(function(){
          $('#TaskUpload').Huploadify({
              auto:false,
              fileTypeExts:'*.jpg;*.png;*.pdf;*.zip;*.doc;*.docx;*.xls;*.xlsx;*.rvt;*.nwd;*.dwg;*.rar',
              multi:true,
              formData:{key:{$file_cid},tid:{$task['tid']},},
              fileSizeLimit:204800,
              showUploadedPercent:true,//是否实时显示上传的百分比，如20%
              showUploadedSize:true,
              removeTimeout:9999999,
              buttonText:'上传附件',
               uploader:'/Bim/upload',
               onUploadStart:function(){
                 //alert('开始上传');
               },
               onInit:function(){
                 //alert('初始化');
               },
               onUploadComplete:function(file){
                   // layer.msg('上传完成',{icon:1});
                   var id = file.id;
                   var ids = id - 1;
                   $('.uploadify-queue-item').eq(ids).find('.uploadbtn').text('上传完成');
               },
               onDelete:function(file){
                   console.log('删除的文件：'+file);
                   console.log(file); 
               },
          })
        });
        
        
       function  findings(){
    	   var file_cid = {$file_cid};
    	   var tid = {$task['tid']};
    	   var remarks = $("textarea[name='remarks']").val();
    	   if(tid == '' || file_cid == ''){
    		   layer.msg('数据id有误',{icon:2});
   		 	    return;
    	   }
    	   if(remarks==''){
          	 layer.msg('描述不能为空',{icon:2});
     		 	 return;
           }
    	   
   	   	  $.ajax({
   		 		type : 'post',
   		 		url : '__URL__/task_audit',
   		 		data : {file_cid:file_cid,tid:tid,remarks:remarks},
   		 		dataType : 'json',
   		 		success : function(res){
   		 			 if(res.status==0){
   							layer.alert(res.info, {icon: 2});
   							return;
   					 }
   		 			 if(!res.errNo){
   		 				 layer.msg(res.msg,{icon:1});
   		 				 setTimeout("location.reload()",2000);
   			          }else{
   			        	 layer.msg(res.msg,{icon:2});
   			          }
   		 		}
  		     });
       }
       
       //删除附件
       function de(id,mname){
    	   if(id == undefined || mname == undefined){
    		   layer.msg('数据有误',{icon:2});
   		 	 	return;
    	   }
    		layer.confirm('删除后不可恢复,您确认删除吗？', {
       		  btn: ['确定','取消'] //按钮
       		}, function(){
       	   	  $.ajax({
     		 		type : 'post',
     		 		url : '/Bim/delFile',
     		 		data : {id:id,filename:mname},
     		 		dataType : 'json',
     		 		success : function(res){
     		 			 if(res.status==0){
     							layer.alert(res.info, {icon: 2});
     							return;
     					 }
     		 			 if(!res.errNo){
     		 				 layer.msg(res.msg,{icon:1});
     		 				 setTimeout("location.reload()",2000);
     			          }else{
     			        	 layer.msg(res.msg,{icon:2});
     			          }
     		 		}
     		     });
       		}, function(index){
      			layer.close(index);
      			return false;// 取消
      		}
       		);
       }
    </script>
    
  </body>
</html>
